﻿// Copyright (c) Microsoft Corporation.  All rights reserved.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

// need to add the post service information.
using MyTravelPostWebsite.MyTravelPostService;

namespace MyTravelPostWebsite
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // create a service and bind the blog entries to the blog grid
                using (MyTravelPostServiceClient travelPost = new MyTravelPostServiceClient())
                {
                    // this calls the travel blogs service.
                    BlogGrid.DataSource = travelPost.GetAllTravelBlogs();                    
                    BlogGrid.DataBind();
                }
            }
        }
    }
}
